﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;
using System.Data;
using System.Configuration;
using DTO;
using BUS;

public partial class LapTop : System.Web.UI.Page
{

    String connectstring = ConfigurationManager.ConnectionStrings["I_Group_WebConnectionString"].ToString();
   // SqlConnection sqlcon;
   // DataTable dt;
   // SqlDataAdapter da;

    public void LoadSanPhamLapTop()
    {
        //dt = new DataTable();
        //sqlcon = new SqlConnection(connectstring);
        //String sql_select = "SELECT SAN_PHAM.ID, SAN_PHAM.MaDanhMucSanPham, SAN_PHAM.TenSanPham, SAN_PHAM.GiaBanHienTai, SAN_PHAM.HinhSanPham, SAN_PHAM.DoUuTien, SAN_PHAM.MaHangSanXuat, SAN_PHAM.SoLuotXem, SAN_PHAM.SoLuotMua, DANH_MUC_SAN_PHAM.ID AS Expr1, DANH_MUC_SAN_PHAM.MaNhomDanhMucSanPham, DANH_MUC_SAN_PHAM.TenDanhMucSanPham FROM SAN_PHAM INNER JOIN DANH_MUC_SAN_PHAM ON SAN_PHAM.MaDanhMucSanPham = DANH_MUC_SAN_PHAM.ID WHERE (DANH_MUC_SAN_PHAM.MaNhomDanhMucSanPham = 1)";
        //da = new SqlDataAdapter(sql_select, connectstring);
        //da.Fill(dt);

        List<SanPhamDTO> listlaptop = SanPhamBUS.LayDanhSachNhomDanhMucSanPham(1);
        CollectionPager3.PageSize = 15;
        CollectionPager3.DataSource = listlaptop; ;
        CollectionPager3.BindToControl = DataList_SanPhamLapTop;
        DataList_SanPhamLapTop.DataSource = CollectionPager3.DataSourcePaged;

    }

    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            LoadSanPhamLapTop();
        }

    }
}
